{include file='public/header.html'}
{include file='public/cp_nav.html'}

<div class="container mtn">
    <div class="panel panel-default">
        <div class="panel-heading">系统配置<span class="pull-right"><a href="javascript:history.back(-1);">返回</a></span></div>
        <div class="panel-body">
            <p>文件位置：<code>app/index/config/site.php</code> 调用方式：<code>site('键名')</code></p>
            <button type="button" class="btn btn-info" onclick="ajaxConfirm('{:url('save_file')}','生成配置文件');">生成配置</button>
            <code> 注意：修改后须生成配置</code>
        </div>
        <table class="table table-striped">
            <thead>
            <tr>
                <th width="120">名称</th>
                <th width="140">键名</th>
                <th>键值</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $list as $vo}
            <form id="myform{$vo.id}" method="post" class="submit-ajax" action="{:url('index')}">
                <input type="hidden" name="id" value="{$vo.id}"/>
                <tr>
                    <td><input type="text" name="name" value="{$vo.name}" class="form-control" placeholder="输入名称"/></td>
                    <td><input type="text" name="config_key" value="{$vo.config_key}" class="form-control" placeholder="输入键名"/></td>
                    <td><input type="text" name="config_value" value="{$vo.config_value}" class="form-control" placeholder="请输入值"/></td>
                    <td><input type="submit" class="btn btn-primary" value="修改" /> <a href="javascript:ajaxConfirm('{:url('del',['id'=>$vo['id']])}','删除',2);" class="btn btn-danger">删除</a></td>
                </tr>
            </form>
            {/foreach}
            <form id="myformadd" method="post" class="submit-ajax" action="{:url('index')}">
                <tr>
                    <td><input type="text" name="name" value="" class="form-control" placeholder="输入名称"/></td>
                    <td><input type="text" name="config_key" value="" class="form-control" placeholder="输入键名"/></td>
                    <td><input type="text" name="config_value" value="" class="form-control" placeholder="请输入值"/></td>
                    <td><input type="submit" class="btn btn-success" value="添加" /></td>
                </tr>
            </form>
            </tbody>
        </table>
    </div>
</div>

{include file='public/footer.html'}
</body>
</html>